<html>
<head>
<title>300px Body</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style1 {color: #FF0000}
.style2 {color: #000000}
-->
.error_strings{ font-family:Verdana; font-size:10px; color:#660000;}

</style>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- ImageReady Slices (300px Body.jpg) -->
<script language="javaScript" type="text/javascript" src="../calander/calendar.js"></script>
<link href="../calander/calendar.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="../logic/validation/validation.js" type="text/javascript"></script>
<script language="javascript" src="../logic/validation/att_student_update.js" type="text/javascript"></script>
<?php        
$id=$_GET['edit'];
$tag=$_GET['tag'];
$startrow=$_GET['startrow'];

include'../logic/Classes/db.php';
	
$x=new Dbconnect();
	
$con=$x->getConnection();
//$sql="Select reg_no,sub_gr,year(attend_date) as year,month(attend_date) as month,day(attend_date) as days from  stud_attend where att_id='$id'";
$sql="Select reg_no,sub_gr,attend_date from  stud_attend where att_id='$id'";

$result= mysql_query($sql,$con) or die(mysql_error());

while($row=mysql_fetch_array($result)) {

$regno=$row['reg_no'];
$subject=$row['sub_gr'];
//$year=$row['year'];
//$month=$row['month'];
//$days=$row['days'];
 $dt1=$row['attend_date'];
		$month=substr($dt1,5,2);
		$year=substr($dt1,0,4);
		$day=substr($dt1,8,2);
}
?>
<table width="800" height="173" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
	<tr>
		<td>
			<img src="../images/st_att_update.gif" width="800" height="69" alt=""></td>
	</tr>
	<tr >
	<td height="64" background="../images/2.gif" style="background-repeat:repeat-y"><table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
	<form id="myForm" onSubmit="return validate()">
      <tr>
        <td width="63" height="25">&nbsp;</td>
        <td width="182" ><div align="right"><strong>Registration No</strong> <span class="style1">*</span> </div></td>
        <td colspan="3" ><input name="txtRegno" type="text" id="txtRegno" value="<?php echo $regno ; ?>" onBlur="checkregno()">
          <input name="txtEdit" type="hidden" id="id" value="<?php echo $id; ?>">
          <input name="txtStartrow" type="hidden" id="startrow" value="<?php echo $startrow; ?>"> 
          <input name="tag" type="hidden" id="tag" value="<?php echo $tag;?> "></td>
        <td width="202" ><span class="style1"> <span class="style2">Required Field </span>* </span></td>
      </tr>
      <tr>
        <td height="19">&nbsp;</td>
        <td>&nbsp;</td>
        <td colspan="3"><div id="ajaxDiv1" class="error_strings"></td>
        <td>&nbsp;</td>
      </tr>
	  
	  <?php 
		  
		    $y=new Dbconnect();
	
	    $con=$y->getConnection();
	 
	    $result1=mysql_query("select sub_gr from subject_code",$con);
	     ?>
      <tr>
        <td height="25">&nbsp;</td> 
        <td><div align="right"><strong>Subject Code</strong>  <span class="style1">*</span> </div></td>
        <td colspan="3"><select name="sltSubgr" id="sltSubgr">
          <option value="Select">Select</option>
		  <?php while($row1=mysql_fetch_array($result1)) {?>
		  <option value="<?php echo $row1['sub_gr'];?>" <?php if ($subject==$row1['sub_gr'] ) { ?>selected="selected" <?php } ?>><?php echo $row1['sub_gr'];  ?>   </option>
          
		  
		  
		  <?php
		 		} ?>
		   </select>        </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td height="19">&nbsp;</td>
        <td>&nbsp;</td>
        <td colspan="3">&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
       <?php 
	   		$attend_date=$day."-".$month."-".$year;
	?>
      <tr>
        <td height="25">&nbsp;</td>
        <td><div align="right"><strong>Attended Date</strong> <span class="style1">* </span></div></td>
        <td colspan="3"><input type="text" name="txtDy" id="txtDy" value="<?php echo "$attend_date" ; ?>">
        <a href="#" onClick="setYears(1985, 2012);
       showCalender(this, 'txtDy');">
      <img src="../calander/calender.png" width="24" height="20"></a>

    <!-- Calender Script  --> 

    <table id="calenderTable">
        <tbody id="calenderTableHead">
          <tr>
            <td colspan="4" align="center">
	          <select onChange="showCalenderBody(createCalender(document.getElementById('selectYear').value,
	           this.selectedIndex, false));" id="selectMonth">
	              <option value="0">Jan</option>
	              <option value="1">Feb</option>
	              <option value="2">Mar</option>
	              <option value="3">Apr</option>
	              <option value="4">May</option>
	              <option value="5">Jun</option>
	              <option value="6">Jul</option>
	              <option value="7">Aug</option>
	              <option value="8">Sep</option>
	              <option value="9">Oct</option>
	              <option value="10">Nov</option>
	              <option value="11">Dec</option>
	          </select>
            </td>
            <td colspan="2" align="center">
			    <select onChange="showCalenderBody(createCalender(this.value,document.getElementById('selectMonth').selectedIndex, false));" id="selectYear">
				</select>
			</td>
            <td align="center">
			    <a href="#" onClick="closeCalender();"><font color="#003333" size="+1">X</font></a>
			</td>
		  </tr>
       </tbody>
       <tbody id="calenderTableDays">
         <tr style="">
           <td>Sun</td><td>Mon</td><td>Tue</td><td>Wed</td><td>Thu</td><td>Fri</td><td>Sat</td>
         </tr>
       </tbody>
       <tbody id="calender"></tbody>
    </table>

<!-- End Calender Script  --></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td height="25">&nbsp;</td>
        <td>&nbsp;</td>
        <td colspan="3"><div id="ajaxDiv" class="error_strings" >     </div></td>
        <td>&nbsp;</td>
      </tr>
	  
      <tr>
        <td height="25">&nbsp;</td>
        <td>&nbsp;</td>
        <td width="66"><input name="Save" type="submit" id="Save" value="Submit" ></td>
        <td width="109"><input type="reset" name="Reset" value="Back" onClick="backxx()"></td>
        <td width="128">&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
	  </form> 
    </table></td>
	</tr>
	<tr>
		<td>
			<img src="../images/3.gif" width="800" height="40" alt=""></td>
	</tr>
</table>
<!-- End ImageReady Slices -->
</body>
</html>